package com.meilai.project.mapper.workflow;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.meilai.project.entity.workflow.VWFDataProcessing;
import com.meilai.project.vo.personal.handle.PersonalHandleVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author 张驰
 * @date 2020/6/5 11:28
 */
@Mapper
public interface VWFDataProcessingMapper extends BaseMapper<VWFDataProcessing> {

    List<PersonalHandleVO> selectToCheckPageList(Page<PersonalHandleVO> page, @Param("user_id") Long userId, @Param("is_web") boolean is_web);

    List<PersonalHandleVO> selectPageList(Page<PersonalHandleVO> page, @Param("user_id") Long userId, @Param("is_web") boolean is_web);

    @Select("SELECT count(1) FROM v_wf_data_processing vwfp JOIN wf_cur_checker wcc ON " +
            "vwfp.id=wcc.wf_data_id AND vwfp.data_id=wcc.data_id " +
            "WHERE wcc.checker_id=#{user_id}")
    Integer getToCheckCount(@Param("user_id") Long userId);
}
